-
Notifications
You must be signed in to change notification settings - Fork 154
chore(logger): make Logger E2E works for all runtimes #559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
E2E test failed due to stack creation timeout: https://github.com/awslabs/aws-lambda-powertools-typescript/actions/runs/1847481128 I increased stack timeout to 300 seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but another option would have been to leverage github actions matrix
That's a good point, it seems that the example shown in this section of the docs would be what we are looking for:
The next section about concurrency also says that it's possible to specify concurrency, the only downside of this is that there's no guarantee that jobs will run in parallel as this is decided based on availability of the runners. If we are okay with this then we could avoid bringing an additional dependency into the project ( Other than this I like how you implemented it and the helpers / constants that you have added. |
@flochaz @dreamorosi I have tried using matrix strategy. However, it breaks the e2e tests in I propose to go with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ijemmy thanks for trying out the other method, your proposal is fine by me and I'd prioritise in this order:
- having e2e test for all utils
- having all utils running on all runtimes
- optimising test harness
So with that said no need to tackle this immediately, thanks a ton for considering it tho!
Description of your changes
Currently, E2E only runs on a single (default) runtime from CDK Lambda module. With this change,
test:e2e
target runs tests in all runtime to detect any bugs from compatibility issue. It will create 1 stack of test Lambda functions per run time and execute the tests in parallel.NodeJS10 has been deprecated. So we will be running on v12 and v14 for now.
Why this approach?
There are several options to achieve this. Here are the main criteria in selecting an approach.
beforeAll()
block) concurrently.Here are the list of options I evaluated:
it.each()
anddescribe.each()
to iterate an array of runtimes. (link) This option doesn't work as Jest won't parallel thebeforeAll()
execution in the same file. It doubles the time to run the tests. In addition, test writers have to explicitly specify an array of run-time, more boilerplate code.run-e2e.ts
that starts subprocess to run concurrently . This works with Node'schild_process
'sexec
. However, the log coloring is lost. In additional, we need to maintain an additional script.forEach
to iteratedescribe
blocks to run each runtime test independently. This also won't runbeforeAll()
in parallel. Jest that decides to run things in parallel or sequential. We have no control over it. describe and it basically put things in an internal queue and jest has some heuristic algorithm to decide. I find that it stops running in parallel when when several describe are called in the same file.How to verify this change
Check out this branch and run
Result from local run
Related issues, RFCs
#353
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.